function N = get_feature_size(type, param)
%% get_feature_size(type, param)
% return predefined feature size, according to type / param.space /
% param.threshold
switch lower(type)
    case 'hist'
        switch lower(param.space)
            case 'dct'
                N = 2*param.threshold + 1;
            case 'grey'
                N = 256;
            case 'color'
                N = 256*3;
        end
    case 'colorhist'
        N = 512;
    case 'colorhist2'
        N = 1000;
    case 'point-hist'
        switch lower(param.space)
            case 'dct'
                N = size(param.points, 2)*(2*param.threshold + 1);
        end
    case 'diff-markov'
        N = 4*(2*param.threshold + 1)^2;
    case 'abs-diff-markov'
        N = 4*(2*param.threshold + 1)^2;
    case 'point-diff-markov'
        N = size(param.points, 2)*4*(2*param.threshold + 1)^2;
    case 'markov'
        switch lower(param.space)
            case 'dct'
                N = 4*(2*param.threshold + 1)^2;
            case 'grey'
                N = 4*param.threshold^2;
            case 'color'
                N = 4*param.threshold^2*3;
        end
    case 'markov2-noncausal'
        N = 8 * (2*param.threshold+1)^3;
    case 'markov2-noncausal-dct'
        N = 8 * (2*param.threshold+1)^3;
    case 'moment'
        switch lower(param.space)
            case 'color'
                N = 3;
            case 'grey'
                N = 1;
        end
    case 'ccpev-274'
        N = 274;
    case 'ccpev-548'
        N = 548;
    case 'lbp_u2(8,1)'
        N = 59;
    case 'lbp_u2(8,1-3)'
        N = 177;
    case 'lbp-test'
        N = 59*59;
    case 'lbp-test2'
        N = 10*10;
    case 'lbp'
        N = 256;
    case 'hist-entropyfilt'
        N = param.threshold;
    case 'hist-rangefilt'
        N = param.threshold;
    case 'hist-stdfilt'
        N = param.threshold;
    case 'gabor'
        N = 96;
    case 'lpq'
        N = 256;
    case 'wld'
        N = 192;
    case 'ltp'
        N = 256*2;
    case 'iflt'
        N = 256;
    case 'iflt2'
        N = 256;
    case 'ldp'
        N = 1024;
    case 'dlbp'
        N = param.k_ratio;
    case 'dlbpk'
        N = sum((param.mapping) ~= 0);
    case 'lfd_c1'
        N = param.Q * length(param.rng);
    case 'lfd_c2'
        N = param.Q * length(param.rng);
    case 'locp'
        N = 256;
    case 'median_f'
        %N = 1593
        N = 6912;
    case 'markovn_f'
        N = 3328;
    case 'clique_f'
        N = 3072;
    case 'lawsmask_f'
        %N = 12390;
        N = 17920;
    case 'lbppe_f'
        %N = 885;
        N = 3840;
    case 'varpe_f'
        %N = 885;
        N = 3840;
    otherwise
        error('get_feature_size:UnknownType', 'Unknown type %s.', lower(type));
end
end %get_feature_size
